

<?php
$array1 = array(array("dist" => 42 , "class" => 'found'),array("dist" => 22, "class" => 'red'));
echo print_r($array1,true);
$result = usort($array1,'compare');
echo print_r($array1,true);
	
	
	function compare($x, $y)
	{
		if ( $x['dist'] == $y['dist'] )
			return 0;
		else if ( $x['dist'] < $y['dist'] )
			return -1;
		else
			return 1;
	}

?>
